<template>
    <div>
        &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;
        &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
        &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        <el-button type="primary" style="float: center" @click="submitForm">返回列表</el-button>
        <br />
        <hr />
        <br />

        <div>
            &nbsp; &nbsp; &nbsp; &nbsp; 表单名称：<span style="color: red">{{ form.tableName }}</span> &nbsp; &nbsp; &nbsp; &nbsp;
            表单描述：<span style="color: red">{{ form.createName }}</span> &nbsp; &nbsp; &nbsp; &nbsp;表单创建时间：<span
                style="color: red"
                >{{ form.createTime }}</span
            >
        </div>

        <hr />
        <br />

        <v-form-render :form-json="formJson" :form-data="formData" :option-data="optionData" ref="vFormRef"> </v-form-render>
    </div>
</template>
  
  <script>
import { RefillFormDesigners } from '@/api/forms';

export default {
    name:'FormRefill',
    props:['id'],

    data() {
        return {
            formJson: {},
            formData: {},
            optionData: {},

            form: {
                tableName: '',
                createName: '',
                createTime: ''
            }
        };
    },

    mounted() {
        //反填//反填表及表信息
        RefillFormDesigners({id: this.id}).then((res) => {
            this.$refs.vFormRef.setFormJson(res.formJson);
            //console.log(ref.data.formJson);
            this.form.tableName = res.formName; //表单名称
            this.form.createName = res.createName;
            this.form.createTime = res.createTime;
        });
    },

    methods: {
        submitForm() {
            this.$router.push('/FormDesigner');
        }
    }
};
</script>
  